#ifndef SCA830_H
#define SCA830_H

enum
{
	STATE_IDLE,
	STATE_OFF,
	STATE_READING,
	STATE_WRITING,
	
	STATE_INITING,
	STATE_STARTING,
	STATE_STOPPING,
	
	STATE_RSTATUS,	
	STATE_RINTERRUPT,
	STATE_RCONTROL,
	STATE_SCONTROL,
	STATE_RX,
	STATE_RTEMP,
};

enum
{
	SCA_CMD_PDOWN = 0x60,
	SCA_CMD_PUP  = 0x40,
};

enum
{
	SCA_WARMUP = 95,	
};

enum
{
	SCA_REG_REVID 		= 0x00,
	SCA_REG_CTRL 		= 0x01,
	SCA_REG_STATUS 		= 0x02,
	SCA_REG_RESET 		= 0x03,
	SCA_REG_X_LSB 		= 0x04,
	SCA_REG_X_MSB 		= 0x05,
	SCA_REG_Y_LSB 		= 0x06,
	SCA_REG_Y_MSB 		= 0x07,
	SCA_REG_Z_LSB 		= 0x08,
	SCA_REG_Z_MSB 		= 0x09,
	SCA_REG_TEMP_LSB 	= 0x12,
	SCA_REG_TEMP_MSB 	= 0x13,
	SCA_REG_INT 		= 0x16,
	SCA_REG_ID 			= 0x27,
};

typedef struct sca_status
{
	bool frameError;
	bool powerOnRst;
	bool selfTest;
	bool saturation;
	bool parity;
}sca_status_t;



#endif /* SCA830_H */
